package cn.campus.util;

/**
 *
 * Created by linyanbin on 2018/10/2.
 */
public class TextUtil {

    private static final String REGEX_HTML = "<[^>]+>";
    private static final String REGEX_BLANK = "\\s*|\t|\r|\n";

    public static String htmm2Text(String htmlStr) {
        htmlStr = htmlStr.replaceAll(REGEX_HTML, "");    // 删除HTML标签
        htmlStr = htmlStr.replaceAll(REGEX_BLANK, "");   // 删除tab、空格、换行
        return htmlStr;
    }

}
